home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / Delphi 3.0 / DATA.Z / PROGIMPL.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-01-30  |  4.0 KB  |  166 lines

  1. unit ProgImpl;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
  7.   ComServ, StdVCL, AXCtrls, DelLib, ComCtrls;
  8.  
  9. type
  10.   TProgressBarX = class(TActiveXControl, IProgressBarX)
  11.   private
  12.     { Private declarations }
  13.     FDelphiControl: TProgressBar;
  14.     FEvents: IProgressBarXEvents;
  15.   protected
  16.     { Protected declarations }
  17.     procedure InitializeControl; override;
  18.     procedure EventSinkChanged(const EventSink: IUnknown); override;
  19.     procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
  20.     function Get_Cursor: Smallint; safecall;
  21.     function Get_DragCursor: Smallint; safecall;
  22.     function Get_Enabled: WordBool; safecall;
  23.     function Get_Max: Integer; safecall;
  24.     function Get_Min: Integer; safecall;
  25.     function Get_Position: Integer; safecall;
  26.     function Get_Step: Integer; safecall;
  27.     function Get_Visible: WordBool; safecall;
  28.     procedure AboutBox; safecall;
  29.     procedure Set_Cursor(Value: Smallint); safecall;
  30.     procedure Set_DragCursor(Value: Smallint); safecall;
  31.     procedure Set_Enabled(Value: WordBool); safecall;
  32.     procedure Set_Max(Value: Integer); safecall;
  33.     procedure Set_Min(Value: Integer); safecall;
  34.     procedure Set_Position(Value: Integer); safecall;
  35.     procedure Set_Step(Value: Integer); safecall;
  36.     procedure Set_Visible(Value: WordBool); safecall;
  37.     procedure StepBy(Delta: Integer); safecall;
  38.     procedure StepIt; safecall;
  39.   end;
  40.  
  41. implementation
  42. uses PrBarPg;
  43. { TProgressBarX }
  44.  
  45. procedure TProgressBarX.InitializeControl;
  46. begin
  47.   FDelphiControl := Control as TProgressBar;
  48. end;
  49.  
  50. procedure TProgressBarX.EventSinkChanged(const EventSink: IUnknown);
  51. begin
  52.   FEvents := EventSink as IProgressBarXEvents;
  53. end;
  54.  
  55. procedure TProgressBarX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
  56. begin
  57.   { Define property pages here.  Property pages are defined by calling
  58.     DefinePropertyPage with the class id of the page.  For example,
  59.       DefinePropertyPage(Class_ProgressBarXPage); }
  60. end;
  61.  
  62. function TProgressBarX.Get_Cursor: Smallint;
  63. begin
  64.   Result := Smallint(FDelphiControl.Cursor);
  65. end;
  66.  
  67. function TProgressBarX.Get_DragCursor: Smallint;
  68. begin
  69.   Result := Smallint(FDelphiControl.DragCursor);
  70. end;
  71.  
  72. function TProgressBarX.Get_Enabled: WordBool;
  73. begin
  74.   Result := FDelphiControl.Enabled;
  75. end;
  76.  
  77. function TProgressBarX.Get_Max: Integer;
  78. begin
  79.   Result := FDelphiControl.Max;
  80. end;
  81.  
  82. function TProgressBarX.Get_Min: Integer;
  83. begin
  84.   Result := FDelphiControl.Min;
  85. end;
  86.  
  87. function TProgressBarX.Get_Position: Integer;
  88. begin
  89.   Result := FDelphiControl.Position;
  90. end;
  91.  
  92. function TProgressBarX.Get_Step: Integer;
  93. begin
  94.   Result := FDelphiControl.Step;
  95. end;
  96.  
  97. function TProgressBarX.Get_Visible: WordBool;
  98. begin
  99.   Result := FDelphiControl.Visible;
  100. end;
  101.  
  102. procedure TProgressBarX.AboutBox;
  103. begin
  104.   ShowProgressBarXAbout;
  105. end;
  106.  
  107. procedure TProgressBarX.Set_Cursor(Value: Smallint);
  108. begin
  109.   FDelphiControl.Cursor := TCursor(Value);
  110. end;
  111.  
  112. procedure TProgressBarX.Set_DragCursor(Value: Smallint);
  113. begin
  114.   FDelphiControl.DragCursor := TCursor(Value);
  115. end;
  116.  
  117. procedure TProgressBarX.Set_Enabled(Value: WordBool);
  118. begin
  119.   FDelphiControl.Enabled := Value;
  120. end;
  121.  
  122. procedure TProgressBarX.Set_Max(Value: Integer);
  123. begin
  124.   FDelphiControl.Max := Value;
  125. end;
  126.  
  127. procedure TProgressBarX.Set_Min(Value: Integer);
  128. begin
  129.   FDelphiControl.Min := Value;
  130. end;
  131.  
  132. procedure TProgressBarX.Set_Position(Value: Integer);
  133. begin
  134.   FDelphiControl.Position := Value;
  135. end;
  136.  
  137. procedure TProgressBarX.Set_Step(Value: Integer);
  138. begin
  139.   FDelphiControl.Step := Value;
  140. end;
  141.  
  142. procedure TProgressBarX.Set_Visible(Value: WordBool);
  143. begin
  144.   FDelphiControl.Visible := Value;
  145. end;
  146.  
  147. procedure TProgressBarX.StepBy(Delta: Integer);
  148. begin
  149.  
  150. end;
  151.  
  152. procedure TProgressBarX.StepIt;
  153. begin
  154.   FDelphiControl.StepIt;
  155. end;
  156.  
  157. initialization
  158.   TActiveXControlFactory.Create(
  159.     ComServer,
  160.     TProgressBarX,
  161.     TProgressBar,
  162.     Class_ProgressBarX,
  163.     17,
  164.     '{5A5659AE-7975-11D0-BE02-00A024D1875C}');
  165. end.
  166.